package com.wsoft.hr.pm.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.wsoft.hr.pm.entity.HrPmCycleEntity;
import com.wsoft.hr.pm.query.cycle.CycleInsertQuery;
import com.wsoft.hr.pm.query.cycle.CycleListQuery;
import com.wsoft.hr.pm.query.cycle.CycleUpdateEnableQuery;
import com.wsoft.hr.pm.query.cycle.CycleUpdateQuery;

import java.util.List;

/**
 * <p>
 * 活动周期 服务类
 * </p>
 *
 * @author zhanggukai
 * @since 2025年02月25日 11:13:43
 */
public interface IHrPmCycleService extends IService<HrPmCycleEntity> {

    /**
     * 新增考核周期
     * @param query
     * @return boolean
     */
    boolean insert(CycleInsertQuery query);

    /**
     * 更新考核周期
     * @param query
     * @return boolean
     */
    boolean update(CycleUpdateQuery query);

    /**
     * 删除考核周期
     * @param id
     * @return boolean
     */
    boolean delete(Long id);

    /**
     * 考核周期详情
     * @param id
     * @return HrPmCycleEntity
     */
    HrPmCycleEntity get(Long id);

    /**
     * 考核周期详情
     * @param query
     * @return HrPmCycleEntity
     */
    PageInfo<HrPmCycleEntity> pageList(CycleListQuery query);

    /**
     * 启用考核周期
     * @param query
     * @return boolean
     */
    boolean enableCycle(CycleUpdateEnableQuery query);

    /**
     * 自动生成考核周期
     * @param query
     */
    void generateCycles (CycleInsertQuery query);

    /**
     * 是否首次添加考核周期
     * @param query
     * @return
     */
    boolean firstAddCycle (CycleInsertQuery query);

    /**
     * 检查时间是否重叠
     * @param cycle
     * @return
     */
    String checkTimeOverlap(CycleUpdateQuery cycle);

    /**
     * 根据id获取
     * @param ids
     * @return
     */
    List<HrPmCycleEntity> getByIds(List<String> ids);
}
